package cn.iocoder.yudao.framework.business.audit.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 审核状态
 *
 * @author 山野羡民
 */
@RequiredArgsConstructor
@Getter
public enum AuditStatusEnum implements EnumValuable {

    WAIT(0, "待审核"),
    PASS(1, "已通过"),
    REJECT(2, "被驳回");

    private final Integer value;
    private final String name;

    @Override
    public String toString() {
        return new ViewObject(value, name).toString();
    }

    public static AuditStatusEnum valueOf(Integer value) {
        for (AuditStatusEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return WAIT;
    }

}
